package com.best.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 *  食谱功效
 *
 * @author yangruyi
 * @date 2021/3/11
 * <p>
 */
public enum EffectType {
    /**
     * 补气
     */
    QI(0),
    /**
     * 养胃
     */
    STOMACH(1);

    @EnumValue
    @JsonValue
    private final int code;

    EffectType(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static EffectType getInstance(int code){
        for (EffectType value : EffectType.values()) {
            if(code == value.code){
                return value;
            }
        }
        return null;
    }
}
